<template>
  <cl-nav
    :menu-data="menuData"
    :bread-crumb="breadCrumb"
    @select="handleSelect"
  >
    <router-view></router-view>
  </cl-nav>
</template>

<script lang="ts">
import Vue from 'vue'

const menuData = [{
    menuUrl: 'icon-shouyexuanzhong',
    menuName: '风格说明',
    menuCode: 'fgsm'
  },{
    menuUrl: 'icon-shouyexuanzhong',
    menuName: '导航菜单',
    menuCode: 'dhcd'
  }]

export default Vue.extend({
  name: 'NavMenuPage',
  data () {
    return {
      menuData: menuData,
      breadCrumb: ['cloudUI', '首页']
    }
  },
  created () {
    // this.getData()
  },
  methods: {
    async getData () {
      let res = await this.$axios.get('/user/authMenu')
      this.menuData = res.data.appAuthMenu
      this.menuData.unshift({
        menuUrl: 'icon-shouyexuanzhong',
        menuName: '风格说明',
        menuCode: 'sxd',
        hasChildren: false
      })
    },
    handleSelect ({index, indexPath}) {
      console.log(index)
      console.log(indexPath)
      // this.breadCrumb = ['cloudUI'].concat(actRouters.map(item => {
      //   return item.menuName
      // }))
    }
  }
})
</script>